package sistema.web.servlet;

import java.io.IOException;
import java.util.List;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import sistema.web.bussiness.IPersonaBussiness;
import sistema.web.bussiness.impls.PersonaBussiness;
import sistema.web.dtos.TipoDocumentoDTO;

/**
 * Servlet implementation class PersonaCargar_Servlet
 */
@WebServlet("/PersonaCargar_Servlet")
public class PersonaCargar_Servlet extends HttpServlet {
	
	private static final long serialVersionUID = 1L;
       
    /**
     * @see HttpServlet#HttpServlet()
     */
    public PersonaCargar_Servlet() {
        super();
    }

	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		List<TipoDocumentoDTO> listTipoDocumento;
		
		IPersonaBussiness bus = new PersonaBussiness();
		listTipoDocumento = bus.obtenerTipoDocumento();
		
		request.setAttribute("listTipoDocumento", listTipoDocumento);
		RequestDispatcher rd = request.getRequestDispatcher("regi_persona.jsp");
        rd.forward(request, response);
	}
}